/**
* Oxide
*
* Copyright (c) 2011 Dinosaur Kick Pty Ltd, All rights reserved.
*
* This source code is made available under the "Modified BSD" licensing arrangement.
* See license.txt for details.
*/
// ----------------------------------------------------------------------------
#include <iterator>
#include "../token.hpp"
// ----------------------------------------------------------------------------
#ifndef O2_PARSE_CURSOR_INCREMENTER_INC
#define O2_PARSE_CURSOR_INCREMENTER_INC
namespace o2 {
namespace parse {
namespace detail {
// ----------------------------------------------------------------------------

template <typename IteratorT>
struct cursor_incrementer
{
	typedef IteratorT iterator_type;
	typedef typename std::iterator_traits<iterator_type>::value_type::string_type string_type;

	iterator_type& operator() (iterator_type& iter)
	{
		if (iter->identity == TOK_BLOCK_COMMENT) {
			doc_block = iter->content;
		} else {
			doc_block.clear();
		}
		return ++iter;
	}
	
	string_type doc_block;
};

// ----------------------------------------------------------------------------
} // namespace detail
} // namespace parse
} // namespace o2
#endif // O2_PARSE_CURSOR_INCREMENTER_INC
// ----------------------------------------------------------------------------
